//
//  MWApplicationPictureCell.m
//  XiRan-iOS
//
//  Created by liuyiming on 2019/10/25.
//  Copyright © 2019 Wood. All rights reserved.
//

#import "MWApplicationPictureCell.h"

@interface MWApplicationPictureCell ()

@property(nonatomic, strong) UIImageView *pictureIV;

@end

@implementation MWApplicationPictureCell

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor whiteColor];
        [self setupPageSubviews];
        return self;
    }
    
    return self;
}

- (void)setUrlPath:(NSString *)urlPath {
    _urlPath = urlPath;
    NSString *urlStr = [NSString stringWithFormat:@"%@?x-oss-process=image/resize,h_300", urlPath];
    [_pictureIV sd_setImageWithURL:[NSURL URLWithString:urlStr] placeholderImage:[UIImage imageNamed:@"infoIcon"]];
}

- (void)setupPageSubviews {
    _pictureIV = [[UIImageView alloc] init];
    _pictureIV.contentMode = UIViewContentModeScaleAspectFit;
    _pictureIV.layer.cornerRadius = 5;
    _pictureIV.layer.masksToBounds = YES;
    [self.contentView addSubview:_pictureIV];
    
    [_pictureIV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.contentView);
    }];
    
}

@end
